<?php

namespace app\admin\controller;

use app\common\controller\Backend;
use think\Config;
use app\admin\model\choi\User as UserModel;
Use app\admin\model\choi\Teacher as TeacherModel;
use app\admin\model\choi\CourseOrder as CourseOrderModel;

/**
 * 控制台
 *
 * @icon fa fa-dashboard
 * @remark 用于展示当前系统中的统计数据、统计报表及重要实时数据
 */
class Dashboard extends Backend
{

    /**
     * 查看
     */
    public function index()
    {
        $studentCounts = UserModel::getUserCounts();
        $teacherCounts = TeacherModel::getTeacherCounts();
        $orderWaitCounts = CourseOrderModel::getWaitCount();
        $orderFinishCounts = CourseOrderModel::getFinishCount();
        $this->assign('studentCounts', $studentCounts);
        $this->assign('teacherCounts', $teacherCounts);
        $this->assign('orderWaitCounts', $orderWaitCounts);
        $this->assign('orderFinishCounts', $orderFinishCounts);
        return $this->view->fetch();
    }

}
